package com.wish.g01.business.es;

import com.wish.g01.base.service.ITbRoomInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Classname A
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/6/13 8:34
 * @Created by wupenghao
 */
@Component
@Slf4j
public class InitData implements ApplicationListener<ContextRefreshedEvent>, InitializingBean {

    @Autowired
    ITbRoomInfoService roomInfoService;

    public InitData() {
        log.info("========================构造器:"+roomInfoService);
    }

    @PostConstruct
    public void init(){
        log.info("========================post:"+roomInfoService);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("========================afterPropertiesSet:"+roomInfoService);
    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        log.info("========================afterPropertiesSet:"+roomInfoService);
    }

}
